package home.Test;

import static org.junit.Assert.*;

import java.util.List;

import org.junit.Test;

import home.dao.CriteriaHome;
import home.dao.HomeDAO;
import home.dao.impl.HomeDAOJdbcImpl;
import home.domain.Home;

public class HomeDAOJdbcImplTest  {
	
	private HomeDAO homeDAO = new HomeDAOJdbcImpl();
	
	@Test
	public void testgetForListWithCriteriaHome(){
		CriteriaHome kk =new CriteriaHome("89");
		List<Home> homes =homeDAO.getForListWithCriteriaHome(kk);
		System.out.println(homes);
	}

	@Test
	public void testGetAll() {
		List<Home> home = homeDAO.getAll();
		System.out.println(home);
	}

	@Test
	public void testSave() {
		Home home = new Home();
		home.setName("Jane");
		home.setPhone("17950386107");
		home.setSex("女");
		home.setAddress("广州");
		
		homeDAO.save(home);
	}

	@Test
	public void testGetInteger() {
		Home hom=  homeDAO.get(7);
		System.out.println(hom);
	}

	@Test
	public void testdelete(){
		homeDAO.delete();
	}
}
